package cn.wolfcode.qo;

import cn.hutool.core.date.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Getter
@Setter
public class ConsumptionQueryObject extends QueryObject {
    /*结算单状态*/
    private Integer statusId;
    /*门店*/
    private Long businessId;
    /*预约类型*/
    private Boolean appointmentType;
    /*客户名字*/
    private String customerName;
    /*客户电话*/
    private String customerTel;
    /*预约流水号*/
    private String appointmentAno;
    /*结算流水号*/
    private String cno;
    /*结算时间范围*/
    @DateTimeFormat(pattern = "yyy-MM-dd")
    private Date startPayTime;
    @DateTimeFormat(pattern = "yyy-MM-dd")
    private Date endPayTime;

    public Date getEndPayTime(){
        if(endPayTime == null){
            return null;
        }
        return DateUtil.endOfDay(endPayTime);
    }

}
